<?php
/**
 * @author Kelvin 
 * @mail dangtrungkien89@gmail.com
 * */
require_once("inc_security.php");
$list = new fsDataGird($id_field,$name_field,translate_text("Countries Listing"));

/*
1: Ten truong trong bang
2: Tieu de header
3: kieu du lieu
4: co sap xep hay khong, co thi de la 1, khong thi de la 0
5: co tim kiem hay khong, co thi de la 1, khong thi de la 0
*/
/*
$pro_id_up = getValue("pro_id_up","int","GET");
$pro_id_down = getValue("pro_id_down","int","GET");
if($pro_id_up){
    $pri = new db_query("SELECT pro_priority FROM project WHERE pro_id = $pro_id_up");
    while($row =mysql_fetch_assoc($pri->result))
    {
        $priority = $row['pro_priority'];
    }
    $pri_next = new db_query("SELECT pro_id,pro_priority FROM project WHERE pro_priority < $priority ORDER by pro_priority DESC LIMIT 0,1");
     while($row =mysql_fetch_assoc($pri_next->result))
    {
        @$priority_next = $row['pro_priority'];
        $pro_id_next = $row['pro_id'];
    }
    if(@$priority_next){
     $temp = $priority;
     $priority = $priority_next;
     $priority_next = $temp;
     //echo $priority;echo $priority_next;
     $update1 = new db_query("UPDATE project SET pro_priority = $priority WHERE pro_id=$pro_id_up");
     $update2 = new db_query("UPDATE project SET pro_priority = $priority_next WHERE pro_id=$pro_id_next");
     }
    
}
if($pro_id_down){
    $pri = new db_query("SELECT pro_priority FROM project WHERE pro_id = $pro_id_down");
    while($row =mysql_fetch_assoc($pri->result))
    {
        $priority = $row['pro_priority'];
    }
    $pri_next = new db_query("SELECT pro_id,pro_priority FROM project WHERE pro_priority > $priority ORDER by pro_priority ASC LIMIT 0,1");
     while($row =mysql_fetch_assoc($pri_next->result))
    {
        $priority_next = $row['pro_priority'];
        $pro_id_next = $row['pro_id'];
    }if(@$priority_next){
     $temp = $priority;
     $priority = $priority_next;
     $priority_next = $temp;
     //echo $priority;echo $priority_next;
     $update1 = new db_query("UPDATE project SET pro_priority = $priority WHERE pro_id=$pro_id_down");
     $update2 = new db_query("UPDATE project SET pro_priority = $priority_next WHERE pro_id=$pro_id_next");
     }
}*/
$list->add("sli_path","Ảnh","string",0,0);
//$list->add("",translate_text("Copy"),"copy");
$list->add("",translate_text("Sửa"),"edit");
$list->add("",translate_text("Xóa"),"delete");
$list->ajaxedit($fs_table);

//Lấy dữ liệu
$total			= new db_count("SELECT COUNT(*) AS count 
										 FROM slide
										 ORDER BY sli_id DESC "); // AND 

$db_listing 	= new db_query("SELECT * 
										 FROM slide
										 ORDER BY sli_id ASC
										 " . $list->limit($total->total));		
$total_row		= 	$total->total;	
													 
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<?php echo $load_header?>
<?php echo $list->headerScript()?>
</head>
<body topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<?php /*---------Body------------*/ ?>
<!--<form action="quickedit.php?returnurl=<?php echo base64_encode(getURL())?>" method="post" name="form_listing" id="form_listing" enctype="multipart/form-data">
<input type="hidden" name="iQuick" value="update" />-->
<div id="listing">
  <?php echo $list->showHeader($total_row)?>
	
  <?php
  	$i = 1;
	while($row	=	mysql_fetch_assoc($db_listing->result))
	{
		?>
		<?php echo $list->start_tr($i, $row['sli_id'])?>
		<td width="200" align="center"><img src="../../../images/slide_image/<?php echo $row['sli_path']?>" alt="<?php echo $row['sli_path']?>" /></td>
	    <?php //echo $list->showCopy($row['pro_id'])?>
		<?php echo $list->showEdit($row['sli_id'])?>
		<?php echo $list->showDelete($row['sli_id'])?>
		<?php echo $list->end_tr()?>
		<?php
		$i	+=1;
	}
	?>

  <?php echo $list->showFooter($total_row)?> 
</div>
<!--</form>-->
<?php /*---------Body------------*/ ?>
</body>
</html>